import {BaseUrl} from "../constant/constant";
import {ApiFetch} from "../api/apiHandler";

class UserModel {
    constructor() {
        this.url = BaseUrl
    }

    all = (params) => {
        let end = this.url + 'getuserbyattr'
        let req = new ApiFetch(end)
        return req.fetch(params)
    }

    black = (params) => {
        let end = this.url + 'getblacklist'
        let req = new ApiFetch(end)
        return req.fetch(params)
    }

    delete = (params) => {
        let end = this.url + 'deluser'
        let req = new ApiFetch(end)
        return req.fetch(params)
    }

    deposit = (params) => {
        let end = this.url + 'getchongzhi'
        let req = new ApiFetch(end)
        return req.fetch(params)
    }

    fuwu = (params) => {
        let end = this.url + 'getfuwu'
        let req = new ApiFetch(end)
        return req.fetch(params)
    }

    jinbi = (params) => {
        let end = this.url + 'getpacketcost'
        let req = new ApiFetch(end)
        return req.fetch(params)
    }

    daoju = (params) => {
        let end = this.url + 'getpacketcostticket'
        let req = new ApiFetch(end)
        return req.fetch(params)
    }

    jubao = (params) => {
        let end = this.url + 'getjubao'
        let req = new ApiFetch(end)
        return req.fetch(params)
    }

    status = (params) => {
        let end = this.url + 'modifistatus'
        let req = new ApiFetch(end)
        return req.fetch(params)
    }

    getByName = (params) => {
        let end = this.url + 'getuserbynick'
        return new ApiFetch(end).fetch(params)
    }

    reg = (params) => {
        let end = this.url + 'getusernumnew'
        let req = new ApiFetch(end)
        return req.fetch(params)
    }

    visitorList = (params) => {
        let end = this.url + 'youkelogininfo'
        let req = new ApiFetch(end)
        return req.fetch(params)
    }

    login = (params) => {
        let end = this.url + 'getusernumactive'
        let req = new ApiFetch(end)
        return req.fetch(params)
    }

    visit = (params) => {
        let end = this.url + 'getusernumloginyouke'
        let req = new ApiFetch(end)
        return req.fetch(params)
    }

    setTag = (params) => {
        let end = this.url + 'setusermark'
        let req = new ApiFetch(end)
        return req.fetch(params)
    }

    addVip = (params) => {
        let end = this.url + 'adduservip'
        let req = new ApiFetch(end)
        return req.fetch(params)
    }

    addSuperVip = (params) => {
        let end = this.url + 'addsupervip'
        let req = new ApiFetch(end)
        return req.fetch(params)
    }

    addCoupon = (params) => {
        let end = this.url + 'adduserprop'
        let req = new ApiFetch(end)
        return req.fetch(params)
    }

    zhuanfa = (params) => {
        let end = this.url + 'getzhuanfa'
        let req = new ApiFetch(end)
        return req.fetch(params)
    }

    xinwen = (params) => {
        let end = this.url + 'getXinWen'
        let req = new ApiFetch(end)
        return req.fetch(params)
    }

    shiping = (params) => {
        let end = this.url + 'getshiping'
        let req = new ApiFetch(end)
        return req.fetch(params)
    }

    liaotian = (params) => {
        let end = this.url + 'getliaotianshi'
        let req = new ApiFetch(end)
        return req.fetch(params)
    }

    liaotianOne = (params) => {
        let end = this.url + 'getliaotianshibyid'
        let req = new ApiFetch(end)
        return req.fetch(params)
    }

    shichang = (params) => {
        let end = this.url + 'getuseronline'
        let req = new ApiFetch(end)
        return req.fetch(params)
    }

    activity = (params) => {
        const ps = [
            this.zhuanfa(params),
            this.xinwen(params),
            this.shiping(params),
            // this.liaotian(params),
        ]
        return Promise.all(ps).then((resp) => {
            const values = resp.map(resp => resp.data.ok)
            return values
        })
    }

    zongshu = (params) => {
        let end = this.url + 'getusernumtotal'
        let req = new ApiFetch(end)
        return req.fetch(params)
    }

    pinglun = (params) => {
        let end = this.url + 'getjoincomment'
        let req = new ApiFetch(end)
        return req.fetch(params)
    }

    online = (params) => {
        let end = this.url + 'getonlinecount'
        let req = new ApiFetch(end)
        return req.fetch(params)
    }

    onlineVip = (params) => {
        let end = this.url + 'getvipusercount'
        let req = new ApiFetch(end)
        return req.fetch(params)
    }

    behavior = (params) => {
        let end = this.url + 'getloginthree'
        let req = new ApiFetch(end)
        return req.fetch(params)
    }

    yqm = (params) => {
        let end = this.url + 'writeyqcode'
        let req = new ApiFetch(end)
        return req.fetch(params)
    }

    激活 = (params) => {
        let end = this.url + 'dayfirstlogin'
        let req = new ApiFetch(end)
        return req.fetch(params)
    }

    userBehavior = (params) => {
        let end = this.url + 'youkedayhandle'
        let req = new ApiFetch(end)
        return req.fetch(params)
    }

    getLoginVip = (params) => {
        let end = this.url + 'getviplogin'
        let req = new ApiFetch(end)
        return req.fetch(params)
    }

    liantiaoDetail = (params) => {
        let end = this.url + 'getmatchchitchat'
        let req = new ApiFetch(end)
        return req.fetch(params)
    }

    sendMsg = (params) => {
        let end = this.url + 'addmsgbyuser'
        let req = new ApiFetch(end)
        return req.fetch(params)
    }

    hitCount = (params) => {
        let end = this.url + 'gettongjidetail'
        let req = new ApiFetch(end)
        return req.fetch(params)
    }

    appActivate = (params) => {
        let end = this.url + 'getactivate'
        let req = new ApiFetch(end)
        return req.fetch(params)
    }

    // total(params) {
    //     const reg = (params) => {
    //         let end = this.url + 'getregusernumbytime'
    //         let req = new ApiFetch(end)
    //         return req.fetch(params)
    //     }
    //
    //     const login = (params) => {
    //         let end = this.url + 'getlastloginusernumbytime'
    //         let req = new ApiFetch(end)
    //         return req.fetch(params)
    //     }
    //
    //     const visit = (params) => {
    //         let end = this.url + 'getlastloginyoukenumbytime'
    //         let req = new ApiFetch(end)
    //         return req.fetch(params)
    //     }
    //     return {
    //
    //     }
    //
    // }
}

export default UserModel
